package com.example.appointment.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/appointment")
public class AppointmentController {
    
    @GetMapping("/list")
    public String listAppointments() {
        return "appointment/list";
    }
    
    @GetMapping("/add")
    public String showAddForm() {
        return "appointment/add";
    }
    
    @GetMapping("/edit/{id}")
    public String showEditForm() {
        return "appointment/edit";
    }
    
    @GetMapping("/delete/{id}")
    public String deleteAppointment() {
        return "redirect:/appointment/list";
    }
}